package com.ruoyi.invoice.service;

import com.ruoyi.invoice.domain.TbInvoice;
import com.ruoyi.invoice.mapper.TbInvoiceMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class InvoiceService {

    @Autowired
    private TbInvoiceMapper tbInvoiceMapper;

    /**
     * 查询
     *
     * @param id 主键
     * @return
     */
    public TbInvoice selectTbInvoiceById(Long id)
    {
        return tbInvoiceMapper.selectTbInvoiceById(id);
    }

    /**
     * 查询列表
     *
     * @param tbInvoice
     * @return
     */
    public List<TbInvoice> selectTbInvoiceList(TbInvoice tbInvoice)
    {
        return tbInvoiceMapper.selectTbInvoiceList(tbInvoice);
    }

    /**
     * 新增
     *
     * @param tbInvoice
     * @return 结果
     */
    public int insertTbInvoice(TbInvoice tbInvoice)
    {
        return tbInvoiceMapper.insertTbInvoice(tbInvoice);
    }

    /**
     * 修改
     *
     * @param tbInvoice
     * @return 结果
     */
    public int updateTbInvoice(TbInvoice tbInvoice)
    {
        return tbInvoiceMapper.updateTbInvoice(tbInvoice);
    }

    /**
     * 批量删除
     *
     * @param ids 需要删除的主键
     * @return 结果
     */
    public int deleteTbInvoiceByIds(Long[] ids)
    {
        return tbInvoiceMapper.deleteTbInvoiceByIds(ids);
    }

    /**
     * 删除信息
     *
     * @param id 主键
     * @return 结果
     */
    public int deleteTbInvoiceById(Long id)
    {
        return tbInvoiceMapper.deleteTbInvoiceById(id);
    }
}
